Willamette Falls, 2018. Credit: Oregon Metro Council
The following report examines Data Access in Real Time (DART) fish passage data observed at Willamette Falls. From 2001-2010, counts of several fish species were recorded moving through the fish ladder. The following code wrangles and visualizes this time-series data to reveal trends in the runs of three salmon species: coho, jack coho, and steelhead.
Data: Columbia Basin Research, University of Washington. 2010. DART Adult Passage Graphics & Text. <http://www.cbr.washington.edu/dart/query/adult_graph_text.>
knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE)
# attach packages
library(tidyverse)
library(here)
library(lubridate)
library(tsibble)
library(feasts)
library(slider)
library(janitor)
# reading in and preparing the data
fish <- read_csv(here("data", "willamette_fish_passage.csv")) %>%
clean_names() %>%
mutate(date = lubridate::mdy(date)) %>% # turning the date into mdy format with lubridate
as_tsibble(key = NULL, index = date) %>% # changing the format to a tsibble for use in time series
select(date, coho, jack_coho, steelhead) # selecting for fish species of interest
# changing all NA values to 0
fish[is.na(fish)] <- 0
# creating a longer df with single observations for each of the fish species of interest
fish_longer <- fish %>%
pivot_longer(cols = 2:4, names_to = "species", values_to = "count") %>% # selecting for fish species of interest
mutate(species = case_when(
species == "coho" ~ "Coho",
species == "jack_coho" ~ "Jack Coho",
species == "steelhead" ~ "Steelhead"))
# creating a dataframe by month for use in visualizing
fish_month <- fish_longer %>%
index_by(month = ~yearmonth(.)) %>% # index by month
group_by(species) %>% # species groups
summarize(monthly_total = sum(count)) %>% # total counts by month
mutate(year = year(month)) # adding a year column
Source: US Army Corps of Engineers, Integrated Environmental Assessment 2016.
ggplot(data = fish_longer, aes(x = date,
y = count,
color = species)) +
geom_line(size = 0.5, alpha = 0.9) +
theme_minimal(12) +
theme(legend.position = c(.6, .75),
legend.title = element_blank(),
legend.text = element_text(
size = 12),
axis.text.x = element_text(
vjust = 8)
) +
scale_color_manual(values = c("dodgerblue3", "goldenrod3", "darkgreen")) +
labs(x = element_blank(), y = "Total fish count per month")
Fig. 1: Time series plot of Coho, Jack Coho, and Steelhead counts by month between 2001 and 2010 at the Willamette Falls fish ladder.
\[\\[.5in]\]
# season plot for each fish species
fish_longer %>%
gg_season(y = count,
pal = c("dodgerblue3", "goldenrod3", "darkgreen"),
season.labels = 1:12) +
theme_minimal(12) +
labs(x = element_blank(), y = "Daily Count") +
theme(axis.text.x = element_text(
size = 12))
Fig. 2: Seasonplot showing how the salmon runs vary for the three species over the course of a year from 2001-2010 at the Wilamette Falls fish ladder.
Jack coho and coho tend to pass through the fish ladder at the same time of year while steelhead move through a different time.
Jack coho and coho runs are shorter in duration, only lasting a couple of months and peaking in October. Outside of the typical run season, these species are very rarely observed.
Steelhead runs are typically around 6 months and occur in the first half of the year. Additionally, steelhead are often observed outside of their typical run season.
\[\\[.5in]\]
fish_annual <- fish_longer %>%
index_by(year = ~year(.)) %>%
group_by(species) %>%
summarize(yearly_counts = sum(count))
ggplot(data = fish_annual, aes(x = year, y = yearly_counts, color = species)) +
geom_line(size = 1, alpha = 0.9) +
theme_minimal(12) +
theme(legend.position = c(.6, .75),
legend.title = element_blank(),
legend.text = element_text(
size = 12),
axis.text.x = element_text(
vjust = 8)
) +
scale_color_manual(values = c("dodgerblue3", "goldenrod3", "darkgreen")) +
labs(x = element_blank(), y = "Total fish count per month") +
scale_x_continuous(n.breaks = 10)
Fig. 3: Annual counts of each of the three species observed at the Willamette Falls fish ladder 2001-2010.
Steelhead abundance has fluctuated significantly year to year across the 10 years of observation.
After being very consistent from 2001-2008, Coho runs increased dramatically in 2009.
Of the three in this analysis, Jack coho are the least observed species at the Wilamette Fish ladder. This stayed relatively consistent over the course of observations.
\[\\[.5in]\]Columbia Basin Research, University of Washington. 2010. DART Adult Passage Graphics & Text. <http://www.cbr.washington.edu/dart/query/adult_graph_text.>